@extends('admin.layout')
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                用户管理
                <small>编辑</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">用户管理</a></li>
                <li class="active">编辑</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速编辑用户</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('admin/user/update') }}"  method='post' >
                        	{{ csrf_field() }}
                            <input type="hidden" name='id' value = "{{ $data ->id }}">
							
                            <div class="box-body">
                            @if(session('info'))

                            <div class="alert alert-danger alert-dismissable">
			                    <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
			                    <h4><i class="icon fa fa-ban"></i> 提示!</h4>
							<p>
							
								{{ session('info') }}
							@endif
							</p>
							</div>

                        	@if (count($errors) > 0)
	                        	<div class="alert alert-danger alert-dismissable">
			                    <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
			                    <h4><i class="icon fa fa-ban"></i> 警告!</h4>
			                     <ol>
								            @foreach ($errors->all() as $error)
								                <li>{{ $error }}</li>
								            @endforeach
								 </ol>
			                   
			                    </div>
		    
								@endif
                                <div class="form-group">
                                    <label for="exampleInputEmail1">用户名</label>
                                    <input type="text" name="name" class="form-control" value="{{ $data -> name }}" id="exampleInputEmail1"
                                           placeholder="请输入6-18位用户名">
                                </div>
								
								

                                 <div class="form-group">
                                    <label for="exampleInputEmail1">邮箱</label>
                                    <input type="text" class="form-control" name="email" value="{{ $data -> email }}" id="exampleInputEmail1"
                                           placeholder="请输入您的邮箱地址">
                                </div>


                                 <div class="form-group">
                                 <label for="exampleInputEmail1">状态</label>
                                    
                                    <select name='status' class="form-control">
                                        <option 
                                        @if($data -> status =='0')
                                            selected = 'selected'
                                        @endif

                                        value='0'>启用</option>
                                        <option
                                        @if($data -> status =='1')
                                            selected = 'selected'
                                        @endif

                                         value='1'>禁用</option>
                                        
                                      
                                    </select>
                                </div>


    
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">更新</button>
                                <button type="submit" class="btn btn-default">重置</button>
                            </div>

                        </form>
                    </div><!-- /.box -->

                
               
                </div><!--/.col (right) -->
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection